<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>确认订单</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="full-screen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="white">
    <meta name="format-detection" content="telephone=no"/>
    <meta name="format-detection" content="address=no">
    <script src="../../js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript">
        var docEl = document.documentElement;
        var clientWidth = docEl.clientWidth;
        docEl.style.fontSize = (clientWidth / 10) + 'px';
        $(document).ready(function () {
            (function (doc, win) {
                var docEl = doc.documentElement,
                        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
                        recalc = function () {
                            var clientWidth = docEl.clientWidth;
                            docEl.style.fontSize = (clientWidth / 10) + 'px';
                        };

                if (!doc.addEventListener) return;
                win.addEventListener(resizeEvt, recalc, false);
                doc.addEventListener('DOMContentLoaded', recalc, false);
            })(document, window);
        });
    </script>
    <link rel="stylesheet" href="../../style/css/index.css"/>
</head>
<body>
<div style="background: #f7f7f7;width: 100%;height: 100%">
    <!--header-->
    <div class="header">
        <img class="back" src="../../style/images/sg_ic_back.png" alt=""/>

        <p class="orderName">确认订单</p>
    </div>
    <!-- content-->
    <div class="contactWay">
        <p class="pay_money">
            <span class="s1">请支付</span>
            <span class="s2" id="good_all">¥189</span>

        <div class="clear"></div>
        </p>
    </div>
    <div class="contactWay">
        <ul class="pay_way">
            <li id="weixin" onclick="callpay()" >
                <img class="ico_wex" src="../../style/images/sg_pay_wx.png">
                <span>微信支付</span>
                <img style="position: absolute;right: 15px;top: 0.6rem;width: 0.2rem;"
                     src="../../style/images/mmh_ic_into_1.png" alt="">

                <div class="clear"></div>
            </li>
            <li style="border:none;" id="ali">
                <img class="ico_wex" src="../../style/images/sg_pay_zfb.png">
                <span>支付宝支付</span>
                <img style="position: absolute;right: 15px;top: 0.6rem;width: 0.2rem;"
                     src="../../style/images/mmh_ic_into_1.png" alt="">

                <div class="clear"></div>
            </li>
        </ul>
    </div>
</div>
</body>
</html>
<script src="../../js/md5.js"></script>
<script src="../../js/md5_need.js"></script>
<script src="../../js/queryString.js"></script>
<script type="text/javascript" charset="utf-8">
    $(document).ready(function () {
        $("#good_all").html("￥" + QueryString.good_all);
    });
    //调用微信JS api 支付
        function jsApiCall(json,id)
        {
            WeixinJSBridge.invoke('getBrandWCPayRequest',json,function(res){
                alert(res.err_code+res.err_desc+res.err_msg);

            });
        }

        function callpay(id)
        {

                    $.ajax({
                        url: "/wx/index.php?order_no="+QueryString.order_no+"&total_fee="+QueryString.good_all,
                        success: function(data){
                            var json = eval('(' + data + ')');
                            if (typeof WeixinJSBridge == "undefined"){
                                if( document.addEventListener ){
                                    document.addEventListener('WeixinJSBridgeReady', jsApiCall(json,id), false);
                                }else if (document.attachEvent){
                                    document.attachEvent('WeixinJSBridgeReady', jsApiCall(json,id));
                                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall(json,id));
                                }
                            }else{
                                jsApiCall(json,id);
                            }
                        }
                    });
        }

</script>